<div data-test="address_log" class="tile tile-muted" data-identifier-log="<%= "#{to_string(@log.transaction.hash)}#{@log.index}" %>">
    <% decoded_result = decode(@log, @log.transaction) %>
    <%= case decoded_result do %>
      <% {:error, :contract_not_verified, _candidates} -> %>
        <div class="alert alert-info">
        <%= gettext "To see accurate decoded input data, the contract must be verified." %>
        <%= case @log.transaction do %>
          <% %{to_address: %{hash: hash}} -> %>
            <% path = address_verify_contract_path(@conn, :new, hash) %>
            <%= gettext "Verify the contract " %><a href="<%= path %>"><%= gettext "here" %></a>
          <% _ -> %>
            <%= nil %>
        <% end %>
        </div>
      <% _ -> %>
        <%= nil %>
    <% end %>
  <dl class="row">
    <dt class="col-md-2"> <%= gettext "Transaction" %> </dt>
    <dd class="col-md-10">
      <h3 class="logs-decoded">
        <%= link(
            @log.transaction,
            to: transaction_path(@conn, :show, @log.transaction),
            "data-test": "log_address_link",
            "data-address-hash": @log.transaction
            ) %>
      </h3>
    </dd>
    <%= case decoded_result do %>
      <% {:error, :could_not_decode} -> %>
        <dt class="col-md-2"><%= gettext "Decoded" %></dt>
        <dd class="col-md-10">
        <div class="alert alert-danger">
          <%= gettext "Failed to decode log data." %>
        </div>
      <% {:ok, method_id, text, mapping} -> %>
        <dt class="col-md-2"><%= gettext "Decoded" %></dt>
        <dd class="col-md-10">
        <table summary="Transaction Info" class="table thead-light table-bordered transaction-input-table">
          <tr>
            <td>Method Id</td>
            <td colspan="3"><code>0x<%= method_id %></code></td>
          </tr>
          <tr>
            <td>Call</td>
            <td colspan="3"><code><%= text %></code></td>
          </tr>
        </table>
        <%= render BlockScoutWeb.LogView, "_data_decoded_view.html", mapping: mapping %>
      <% {:error, :contract_not_verified, results} -> %>
        <%= for {:ok, method_id, text, mapping} <- results do %>
            <dt class="col-md-2"><%= gettext "Decoded" %></dt>
            <dd class="col-md-10">
            <table summary="Transaction Info" class="table thead-light table-bordered transaction-input-table">
              <tr>
                <td>Method Id</td>
                <td colspan="3"><code>0x<%= method_id %></code></td>
              </tr>
              <tr>
                <td>Call</td>
                <td colspan="3"><code><%= text %></code></td>
              </tr>
            </table>
            <%= render BlockScoutWeb.LogView, "_data_decoded_view.html", mapping: mapping %>
        <% end %>
      <% end %>
    <dt class="col-md-2"><%= gettext "Topics" %></dt>
    <dd class="col-md-10">
      <div class="raw-transaction-log-topics">
        <%= unless is_nil(@log.first_topic) do %>
          <div class="text-dark">
            <span class="text-dark">[0]</span>
            <%= @log.first_topic %>
          </div>
        <% end %>
        <%= unless is_nil(@log.second_topic) do %>
          <div class="text-dark">
            <span class="">[1] </span>
            <%= @log.second_topic %>
          </div>
        <% end %>
        <%= unless is_nil(@log.third_topic) do %>
          <div class="text-dark">
            <span>[2]</span>
            <%= @log.third_topic %>
          </div>
        <% end %>
        <%= unless is_nil(@log.fourth_topic) do %>
          <div class="text-dark">
            <span>[3]</span>
            <%= @log.fourth_topic %>
          </div>
        <% end %>
      </div>
    </dd>
    <dt class="col-md-2">
      <%= gettext "Data" %>
    </dt>
    <dd class="col-md-10">
      <%= unless is_nil(@log.data) do %>
        <div class="text-dark raw-transaction-log-data">
          <%= @log.data %>
        </div>
      <% end %>
    </dd>
  </dl>
</div>
